﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using djpp.DomainModel;

namespace djpp.gui
{
    public class MenuItemEx : MenuItem
    {
        public MenuItemEx(ICommand command)
        {
            _command = command;
            Text = command.Descr;

            Click += new EventHandler(ExecuteCommand);
        }

        private void ExecuteCommand(object sender, EventArgs e)
        {
            _command.Execute();
        }

        private ICommand _command;
    }
}
